function dctresult = DCTImage(image, qft)
    if nargin < 2
        qft = ones(8,8);
    end
    [row_img, col_img] = size(image);
    row = ceil(row_img/8)*8;
    col = ceil(col_img/8)*8;
    img = zeros(row,col);
    img(1:row_img,1:col_img) = double(image)-128;
    dctresult=[];
    for i = 1:8:row
        for j = 1:8:col
            dctresult(i:i+7,j:j+7) = round(dct2(img(i:i+7,j:j+7))./qft);
        end
    end
end